const express = require('express');
const router = express.Router();

const BillController = require('../controller/BillController');
const CommonController = require('../controller/CommonController');


// 列表 + 分页 + 模糊查询
router.get('/list', BillController.getList);

// 获取账单详情
router.get('/:id', BillController.getBillById);

//上传文件
router.post('/upload', (req,res)=>CommonController.uploadFile(req,res));

// 添加账单（支持上传收据图片）
router.post('/add', BillController.addBill);
// router.post('/add', BillController.addBill);

// 编辑账单
router.put('/:id', BillController.updateBill);


module.exports = router;